
<script type="text/javascript">
{literal}
	$(document).ready(function() {
		$('#labGroupNameUpdate').bind('click', function() {
			var text = $('#labGroupName').val();
            var id = $('#labGroupNameGroupId').val();
            saveLabGroupSec1(id, text);
		});

		$('#labGroupNameAdd').bind('click', function() {
            var text = $('#labGroupName').val();            
            saveLabGroupSec1('', text);
        });
        
		$('#labGroupSelect').bind('change', function() {
			showMessage('statusMessage', '', 'success');
			var text = $('#labGroupSelect :selected').html();
			var id = $('#labGroupSelect :selected').val();	
			selectedLabGroupIdSec1 = id;		
			$('#labGroupName').val(text);
			$('#labGroupNameGroupId').val(id);
			if ($('#labGroupNameGroupId').val() != '') {
	            $('#labGroupNameUpdate').attr('disabled',false);
	        }
		});

		if ($('#labGroupNameGroupId').val() != '') {
            $('#labGroupNameUpdate').attr('disabled',false);
        } else {
            $('#labGroupNameUpdate').attr('disabled','disabled');
        }
		
		
	});
{/literal}
</script>

<div>&nbsp;<span id="statusMessage" style="font-style: italic; color: red;"></span></div>
<div style="float: left;">
<table class="inline" cellspacing="0" cellpadding="0" width="500px;">
	<tr>
		<td width="200px;" class="label">{translate}Group name{/translate}<td>
		<td width="300px">
		<input id="labGroupName" type="text" style="width: 300px;" value="" />
		<input id="labGroupNameGroupId" type="hidden" value="" />
		</td>		
	</tr>	
	<tr>
	   <td style="text-align: right;" colspan="3">
	   <input id="labGroupNameAdd" type="button" value="{translate}Add{/translate}"/>
	   &nbsp;
	   <input id="labGroupNameUpdate" type="button" value="{translate}Update{/translate}"/></td>
	</tr>	
</table>
</div>
<div style="float: none">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<select id="labGroupSelect" size="10" style="width: 300px;">{html_options options=$labGroups selected=$selectedLabGroup}</select>
</div>
